package com.xd.core.business.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xd.common.exception.XkdException;
import com.xd.core.business.entity.Information;
import com.xd.core.business.mapper.InformationMapper;
import com.xd.core.business.service.IInformationService;
import com.xd.core.business.vo.InformationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用印资料表 服务实现类
 * </p>
 *
 * @author zch
 * @since 2025-06-24
 */
@Service
public class InformationServiceImpl extends ServiceImpl<InformationMapper, Information> implements IInformationService {

    @Autowired
    private InformationMapper informationMapper;

    /***
     * @description 获取用印资料列表
     * @author Zch
     * @date 11:51 2025/7/1 星期二
     * @return com.xd.core.business.vo.InformationVo
     **/
    @Override
    public List<InformationVo> getInfomationList(String uid, String typeOfSealUsed) {
        if (StrUtil.isEmpty(uid) || StrUtil.isEmpty(typeOfSealUsed))
            throw new XkdException("参数错误");
        return informationMapper.getInfomationList(uid, typeOfSealUsed);
    }

    /***
     * @description 获取退保凭证
     * @author Zch
     * @date 15:29 2025/7/7 星期一
     * @return com.xd.core.business.vo.VouchersVo
     **/
    @Override
    public List<String> getVouchers(Integer surrenderId) {
        return informationMapper.getVouchers(surrenderId);
    }
}
